package com.myweb.demo.repository;

import com.myweb.demo.entity.Plate;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface PlateRepository extends JpaRepository<Plate,Long> {
    @Override
    List<Plate> findAll();

    @Query("select p from Plate p where p.plateId=?1")
    Plate getOnePlateByPlateId(Long id);

    @Query("select  p from  Plate p order by p.postCount")
    List<Plate> getbestPost();



}
